<template>
  <u-notice-bar :text="sysMsg" direction="column" color="#fd9903" />
</template>

<script>
import { mapState } from "vuex";

export default {
  props: {
    text: Array,
  },
  computed: {
    ...mapState(["homeData"]),
    sysMsg() {
      if (this.text?.length) {
        return this.text;
      }
      const { homeTip: desc } = this.homeData || {};
      if (!desc) return;
      return desc.split(/\n/).filter((it) => !!it);
    },
  },
};
</script>
